<?xml version="1.0" encoding="ISO-8859-1"?>
<%@ page contentType="text/xml;charset=UTF-8" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="javax.jdo.Query" %>
<%@ page import="appnode.Node" %>
<%@ page import="appnode.Ratings" %>
<%@ page import="appnode.RateUtils" %>
<%@ page import="appnode.SearchNode" %>
<%@ page import="appnode.Link" %>
<%@ page import="appnode.Interface" %>
<%@ page import="appnode.NodeRating" %>
<%@ page import="appnode.PMF" %>
<%@ page import="com.google.appengine.api.datastore.Key"%>
<%@ page import="com.google.appengine.api.datastore.KeyFactory;"%>

<table>
<%
	PersistenceManager pm = PMF.get().getPersistenceManager();
	Query query = pm.newQuery(Link.class);
	List<Link> results = (List<Link>) query.execute();

	for (Link link : results) {

		Key key1 = KeyFactory.stringToKey(link.getName1());
		Key key2 = KeyFactory.stringToKey(link.getName2());

		Interface if1 = pm.getObjectById(Interface.class,key1);
		Interface if2 = pm.getObjectById(Interface.class,key2);

		Node node1 = if1.getNode();
		Node node2 = if2.getNode();
		String linkname = node1.getNodename() + "," + node2.getNodename();
%>
				<name><%out.print(linkname);%></name>
				<freq><%out.print(link.getFreq());%></freq>
				<point1lat><%out.print(node1.getLat());%></point1lat>
				<point1lng><%out.print(node1.getLng());%></point1lng>
				<point2lat><%out.print(node2.getLat());%></point2lat>
				<point2lng><%out.print(node2.getLng());%></point2lng>
				<power><%out.print(link.getPower());%></power>

<%
		} // for
%>
</table>

	

